<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8" %>
<!-- saved from url=(0030)http://localhost:8080/Console/ -->
<html lang="zh-cn"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="resources/css/login.css">
    <script type="text/javascript" src="resources/Hplus/js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="resources/js/common/common.js"></script>
    <script type="text/javascript">
        $(function() {
            $('#submitBtn').click(function() {
                var account = $.trim($('#usrName').val());
                var pwd = $.trim($('#loginPwd').val());
                var backUrl =  $.trim($('#backUrl').val());
                var submitBtn = $(this);
                if (submitBtn.hasClass('disabled'))
                    return;
                submitBtn.addClass('disabled');
                if (account == '') {
                    alert("用户名不能为空");
                    submitBtn.removeClass('disabled');
                    return;
                } else if (pwd == '') {
                    alert("密码不能为空");;
                    submitBtn.removeClass('disabled');
                    return;
                }
                $.ajax({
                    type: 'post',
                    url: 'doLogin.json',
                    data: {
                        'account': account,
                        'pwd': pwd
                    },
                    dataType: 'json',
                    success: function (res) {
                        submitBtn.removeClass('disabled');
                        var status = res.rspCode;
                        if(status == '0') {
                            alert(res.rspMsg)
                        } else if (status == '0000') {
                            if(backUrl == null || backUrl == ''){
                                location.href = preUrl+'/member/toShow.htm';
                            }else{
                                location.href = preUrl+backUrl;
                            }
                        }

                    }
                });
            });
        });
    </script>
</head>
<body class="theme-default">
    <header>
        <img src="resources/css/logo.png" alt="I²">
    </header>
    <form action="#" method="post" onsubmit="return false">
        <input type="text"id="usrName" placeholder="请输入管理员账号">
        <input type="password"id="loginPwd" placeholder="请输入授权密码">
        <button id="submitBtn" type="button">登录</button>

    </form>

    <input type="hidden" id="backUrl" value="${backUrl}"/>

    <footer>
        Copyright © 2016 上海益倍嘉信息技术有限公司
        <br>
        Designed by: ebeijia
    </footer>


</body></html>